﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Blogs
{
    public partial class Enroll : Form
    {
        public Enroll()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            var ids = textBox1.Text;
            var pwd = textBox2.Text;
            var repwd = textBox3.Text;

            var uids = !string.IsNullOrEmpty(ids);
            var upwd = !string.IsNullOrEmpty(pwd);

            if (ids==null)
            {
                MessageBox.Show("请输入正确的用户名！");

            }

            else
            {
                if (pwd == repwd)
                {
                    if (uids && upwd)
                    {
                        MessageBox.Show("注册成功!");
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("注册失败!");
                    }
                }
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
